//
//  ZPAdvertiseViewController.m
//  ZPIOSEducation
//
//  Created by mini1 on 2016/11/24.
//  Copyright © 2016年 mini1. All rights reserved.
//

#import "ZPAdvertiseViewController.h"

@interface ZPAdvertiseViewController ()

@property (nonatomic, strong) UIWebView *webView;

@end

@interface ZPAdvertiseViewController ()

@end

@implementation ZPAdvertiseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.title = @"点击进入广告链接";
    self.view.backgroundColor = [UIColor whiteColor];
    
    [self setupWebView];
}


- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    
}


- (void)setupWebView {
    
    _webView = [[UIWebView alloc] initWithFrame:self.view.bounds];
    _webView.backgroundColor = [UIColor whiteColor];
    if (self.advertiseUrl == nil) {
        
        self.advertiseUrl = @"http://www.jianshu.com";
    }
    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:self.advertiseUrl]];
    [_webView loadRequest:request];
    [self.view addSubview:_webView];
}

- (void)setAdvertiseUrl:(NSString *)advertiseUrl {
    
    _advertiseUrl = advertiseUrl;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
